package br.edu.ufam.controleAcesso

class Grupo {
    
    static auditable = true

    static mapping = {
        id generator:'uuid'
    }

    String id
    String descricao
    Date dateCreated
    Date lastUpdated
    Usuario usuarioCreated
    Usuario usuarioUpdated    

    static constraints = {
        descricao(blank:false, nullable:false, maxSize:50, unique:true)
    }

    String toString(){
        "${descricao}"
    }

    boolean equals(o) {
        if (this.is(o))
            return true;
        if (!o || getClass() != o.class)
            return false;
        Grupo grupo = (Grupo) o;
        if (this.id ? !this.id.equals(grupo.id) : grupo.id != null) return false;
        return true;
    }

    int hashCode() {
        return (this.id ? this.id.hashCode() : 0);
    }

}
